﻿// Using delegates write a class Timer that has can execute certain method at each t seconds.

namespace _07.ExecuteMethodPeriodically
{
    using System;
    using System.Linq;

    public class ExecuteMethodPeriodically
    {
        public static void Main()
        {
            Timer timer = new Timer(TimeSpan.FromSeconds(1), PrintDateTimeNow);
        }

        private static void PrintDateTimeNow()
        {
            Console.WriteLine(DateTime.Now);
        }
    }
}
